use hello_world::greeter_client::GreeterClient;
use hello_world::HelloRequest;

pub mod hello_world {
    tonic::include_proto!("helloworld");
}


pub async fn get_grpc() -> Result<String, Box<dyn std::error::Error>> {

    
    let mut client = match GreeterClient::connect("http://[::1]:50051").await{
        Ok(client) => client,
        Err(err) => panic!("{:}", err),
    };
    println!("s{}dsdds","sdsd");
    let request = tonic::Request::new(HelloRequest {
        name: "Tonic".into(),
    });

    let response = client.say_hello(request).await?;
    let res_str = format!("RESPONSE={:?}", response);
    println!("RESPONSE={}", res_str);

    Ok(res_str)
}
